package br.com.skytef.utils;

import java.text.DecimalFormat;
import java.text.Normalizer;

public class StringsUtils {

	public static String removeAccents(String str) {

		str = Normalizer.normalize(str, Normalizer.Form.NFD);
		str = str.replaceAll("[^\\p{ASCII}]", "");
		return str;
	}
	
	public static String formatSpace(String str, int size){
		String temp = "";

		for(int i = str.length(); i < size;i++){
			temp = temp + " ";
		}
		
		str = str + temp;
		
		return str.substring(0,size);
	}	
	
	public static String formatZeros(String str, int size){
		String temp = "";

		for(int i = str.length(); i < size;i++){
			temp = temp + "0";
		}
		
		return temp + str;
	}		
		
	public static String formatDecimal(double value){
		DecimalFormat dec = new DecimalFormat("###,###,##0.00");           
		return dec.format(value); 
	}
}
